/**
 * LEKU APPLIANCE CHAINS.
 * Copyright (c) 2016-2016 All Rights Reserved.
 */
package com.leku.mse.dao.impl.oms;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.leku.commons.datasource.DataSourceClient;
import com.leku.mse.dao.oms.OrderDao;
import com.leku.mse.entity.oms.OrderDiaryEntity;

/**
 * 功能描述:
 *
 * @author suiying
 * @created 2018年1月26日
 * @version 1.0.0
 */
@Repository
public class OrderDaoImpl implements OrderDao {

    @Autowired
    private DataSourceClient dataSourceClient;

    /*
     * (non-Javadoc)
     * @see com.leku.mse.dao.oms.OrderDao#queryOrderDiary(java.lang.String, java.lang.String)
     */
    @Override
    public List<OrderDiaryEntity> queryOrderDiary(String userId, String orderId) {
        Map<String, Object> param = new HashMap<String, Object>();

        param.put("userId", userId);
        param.put("orderId", orderId);

        return dataSourceClient.selectList("OrderDao.queryOrderDiary", param);
    }

    /*
     * (non-Javadoc)
     * @see com.leku.mse.dao.oms.OrderDao#updateOrderDiary(com.leku.mse.entity.oms.OrderDiaryEntity)
     */
    @Override
    public int updateOrderDiary(OrderDiaryEntity orderDiary) {

        return dataSourceClient.update("OrderDao.updateOrderDiary", orderDiary);
    }

}
